package com.haiyou.common.util.date;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class UTCDateUtils {

	public static final String format = "yyyy-MM-dd'T'HH:mm:ss.SSS Z";

	/**
	 * 转换成时间戳
	 * 
	 * @param date
	 * @return
	 */
	public static long parse(String date) {

		try {
			date.replace("Z", " UTC");
			String TimeStart = date.replace("Z", " UTC");
			SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS Z");
			Date date1 = format.parse(TimeStart);
			return date1.getTime();
		} catch (ParseException e) {
			//log.error(e.getMessage(), e);
			return -1l;
		}
	}
}
